﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HR_interfaces;
using entity;
using DataObject;
namespace HR_Implements
{
    public class EmployeeRemotingObject : MarshalByRefObject, IEmployeeRemotingObject
    {
        context.HRdbDataContext ctx = new context.HRdbDataContext();

        public List<EmployeeEntity> getAllEmployees()
        {
            List<EmployeeEntity> emp_list = null;
            var q= from e in ctx.Employees
                   select e;
            emp_list = q.ToList();
            return emp_list;
        }
        public List<EmployeeEntity> getEntityEmployee()
        { 
            var q = from e in ctx.Employees
                        select new EmployeeEntity()
                        {
                            EmployeeCode = e.cEmployeeCode,
                            FristName = e.vFirstName,
                            LastName = e.vLastName,
                            City = e.cCity,
                            Address= e.vAddress
                        };
            return q;
        }
    }
}
